package com.frxuexi.lib_base.room

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.OnConflictStrategy
import androidx.room.Query
import androidx.room.Update

@Dao
interface UserDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun register(user: User):Long

    @Query("select * from user where uname=:uname and upass=:upass and role=:role")
    fun login(uname:String,upass:String,role:String):User

    @Update
    fun updataLogin(user: User):Int

    @Query("select * from user where isLogin=true")
    fun getLogin():List<User>


}